package com.yygo.model;

import com.yygo.model.enums.CommissionStatus;

import javax.persistence.*;

/**
 * Created by tiansha on 2015/11/29.
 */
@Entity
@Table(name = "commission_transfer_record")
public class CommissionTransferRecord {

    private Long id;
    private LoanRequest loanRequest;

    private CommissionStatus cityCommissionStatus;
    private MoneyTransferRecord cityCommissionTransferRecord;

    private CommissionStatus countyCommissionStatus;
    private MoneyTransferRecord countyCommissionTransferRecord;

    private CommissionStatus dealerCommissionStatus;
    private MoneyTransferRecord dealerCommissionTransferRecord;

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @OneToOne
    @JoinColumn(name="req_id")
    public LoanRequest getLoanRequest() {
        return loanRequest;
    }

    public void setLoanRequest(LoanRequest loanRequest) {
        this.loanRequest = loanRequest;
    }

    @Enumerated(value = EnumType.STRING)
    @Column(name="city_commission_status")
    public CommissionStatus getCityCommissionStatus() {
        return cityCommissionStatus;
    }

    public void setCityCommissionStatus(CommissionStatus cityCommissionStatus) {
        this.cityCommissionStatus = cityCommissionStatus;
    }

    @OneToOne
    @JoinColumn(name="city_transfer_id")
    public MoneyTransferRecord getCityCommissionTransferRecord() {
        return cityCommissionTransferRecord;
    }

    public void setCityCommissionTransferRecord(MoneyTransferRecord cityCommissionTransferRecord) {
        this.cityCommissionTransferRecord = cityCommissionTransferRecord;
    }

    @Enumerated(value = EnumType.STRING)
    @Column(name="county_commission_status")
    public CommissionStatus getCountyCommissionStatus() {
        return countyCommissionStatus;
    }

    public void setCountyCommissionStatus(CommissionStatus countyCommissionStatus) {
        this.countyCommissionStatus = countyCommissionStatus;
    }

    @OneToOne
    @JoinColumn(name="county_transfer_id")
    public MoneyTransferRecord getCountyCommissionTransferRecord() {
        return countyCommissionTransferRecord;
    }

    public void setCountyCommissionTransferRecord(MoneyTransferRecord countyCommissionTransferRecord) {
        this.countyCommissionTransferRecord = countyCommissionTransferRecord;
    }

    @Enumerated(value = EnumType.STRING)
    @Column(name="dealer_commission_status")
    public CommissionStatus getDealerCommissionStatus() {
        return dealerCommissionStatus;
    }

    public void setDealerCommissionStatus(CommissionStatus dealerCommissionStatus) {
        this.dealerCommissionStatus = dealerCommissionStatus;
    }

    @OneToOne
    @JoinColumn(name="dealer_transfer_id")
    public MoneyTransferRecord getDealerCommissionTransferRecord() {
        return dealerCommissionTransferRecord;
    }

    public void setDealerCommissionTransferRecord(MoneyTransferRecord dealerCommissionTransferRecord) {
        this.dealerCommissionTransferRecord = dealerCommissionTransferRecord;
    }
}
